17. FileFlex Information Functions

This section outlines three functions that don't fit logically into other places in the manual:

Count Records with DBCount

Use this function whenever you want to know how many records are in a dBASE file. For example:
  put DBCount() into howMany

Calculate an Average with DBAverage

With this function, you can calculate the average of a designated field's values in all of the records of a database file. The function requires the name of a field as an argument. The field must contain numeric data or an error will result. Here is a typical call to this function:
  put DBAverage("Salary") into avgSal

Calculate the Sum of a Field with DBSum

With the FileFlex DBSum function, you can calculate the total of a designated field's values in all of the records of a database file. The function requires the name of a field as an argument. The field must contain numeric data or an error will result. Here is a typical call to this function:
  put DBSum("Salary") into bigBucks


  [Previous Chapter]    [Table of Contents]    [Next Chapter]


Copyright (c) 1996 David Gewirtz under license to Component Software Corp. All rights reserved worldwide.